﻿Imports Helpers
Partial Public Class Menu
    Inherits System.Web.UI.UserControl
    Dim help As New Common
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim selPage As String = Request.Path.Substring(Request.Path.LastIndexOf("/")).Replace("/", String.Empty).ToLower
            Dim selItem As String = "lnkdefault"
            If Not String.IsNullOrEmpty(selPage) AndAlso selPage.EndsWith(".aspx") Then
                selItem = "lnk" & selPage.Replace(".aspx", String.Empty)
                'If selPage.Replace(".aspx", String.Empty) = "annunci" Then
                '    If Request.QueryString("tipo") = 1 Then
                '        selItem = "lnkaffitto"
                '    Else
                '        selItem = "lnkvendita"
                '    End If
                'End If
            End If
            help.ResetMenu(nav, selItem)
            ddlTipoImmobile.DataSource = DAL.Context.TipoImmobile.OrderBy(Function(a) a.Descrizione).ToList
            ddlTipoImmobile.DataBind()
            ddlTipoImmobile.Items.Insert(0, New ListItem("-Seleziona Immobile-", 0))
        End If
    End Sub
End Class